// pages/follow-up-appointment/follow-up-appointment.js
Page({
	data: {
		patientName: '',
		department: '',
		subDepartment: '',
		campus: ''
	},

	onLoad(options) {
		console.log('复诊配药详情页面加载')
		console.log('页面参数:', options)
		
		if (options.patient) {
			this.setData({
				patientName: options.patient
			})
		}
		
		if (options.department) {
			this.setData({
				department: options.department
			})
		}
		
		if (options.subDepartment) {
			this.setData({
				subDepartment: options.subDepartment
			})
		}
		
		if (options.campus) {
			this.setData({
				campus: options.campus
			})
		}
	},

	goToPrescription() {
		console.log('跳转到查看处方页面')
		wx.navigateTo({
			url: '/pages/view-prescription/view-prescription?patient=' + this.data.patientName + '&department=' + this.data.department + '&subDepartment=' + this.data.subDepartment + '&campus=' + this.data.campus
		})
	},

	goToRefill() {
		console.log('跳转到选择处方配药页面')
		wx.navigateTo({
			url: '/pages/prescription-select/prescription-select?patient=' + this.data.patientName + '&department=' + this.data.department + '&subDepartment=' + this.data.subDepartment + '&campus=' + this.data.campus
		})
	}
})
